/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * 
 Clase padre de todas los objetos
 */
function Rear(name) {
    this.name = name;
    this.render = function() {
//        console.log("dentro de la funcion del padre");
    };
}

/**
 Clase Contenedor
 @name Contenedor
 @param {String} id Id del contenedor
 * */
function Conten(id) {
    Rear.call(this, id);
    this.id = id;
    this.formlist = [];
    //top: 48px; clip: rect(-10px, 500px, 2000px, -10px); height: 297px;
    this.padding = 5;
    this.margin = 5;

    this.render = function() {
//        console.log("llamandoo a render de contendor>" + this.id + "::" + name);
        var html;
        html = document.createElement("div");
        html.id = this.id;
        html.className = 'cards';
        for (var i = 0; i < this.formlist.length; i++) {
            html.appendChild(this.formlist[i].render());
        }
        return html;
    };

    /**
     * @name addForm
     * @param {String} form Elemento Formulario.
     * */
    this.addForm = function(form) {
        this.formlist[this.formlist.length] = form;
//        document.getElementById(this.id).appendChild(this.formlist[this.formlist.length - 1].render());
    };

    /**
     * @name removeForm
     * @param {String} index Remueve del aray en base al index el formulario.
     * */
    this.removeForm = function(index) {
        document.removeChild(document.getElementById(this.formlist[index]));
        //acciones para remover el formulario
    };

    /**
     * @name getForm
     * @param {String} index Conseguir formulario de la lista.
     * */
    this.getForm = function(index) {
        return this.formlist[index];
    };

    /**
     * @name removeallForm
     * */
    this.removeallForm = function() {
        this.formlist = [];
    };

}
//Linea obligatoria
Conten.prototype = new Rear;


/**
 Clase Formulario
 @name Formulario
 @param {String} id Nombre del formulario
 @param {String} title Titulo del formulario
 * */
//function Form(id, title) {
function Form(options) {
    Rear.call(this, options.id);
    var self = this;
    this.id = options.id;
    this.title = options.title ? options.title : '';
    this.sub_title = options.sub_title ? options.sub_title : '';
    this.width = options.width ? options.width : 400;
    this.height = 0;
    this.itemlist = [];
    this.visible = options.visible;
    this.hidden = options.hidden ? options.hidden : false;
    this.p = options.padding ? options.padding : 13;
    this.t = options.top ? options.top : 0;
    
    var my_action = null;

    this.render = function() {
//        console.log("llamandoo a render de contendor>" + this.name + "::" + name);
        var html;
        html = document.createElement("div");
        html.className = 'cards-card';
//        html.innerHTML = this.title;
        html.id = this.id;
        html.style.width = this.width + 'px';
        if (this.t != null)
            html.style.top = this.t + 'px';
        if (!this.visible)
            html.style.display = 'none';

        var hd;
        hd = document.createElement("div");
        hd.id = "form_" + this.id;
        hd.className = 'cards-entity cards-padding';
        if (this.title == "")
            hd.style.display = 'none';
        if (this.sub_title == '')
            hd.style.padding = '15px 5px 23px 2px';
        else
            hd.style.padding = '15px 5px 1px 2px';



        //----------------------------------------------------------------
        var hdB;
        hdB = document.createElement("div");
        hdB.className = 'cards-entity-b';

        var hdB_h;
        hdB_h = document.createElement("div");
        hdB_h.className = 'hideable-element';

        var hdB_hi;
        hdB_hi = document.createElement("div");
        hdB_hi.className = 'cards-entity-icons cards-disable-text-selection';

        var hdB_hi_a;
        hdB_hi_a = document.createElement("a");
        hdB_hi_a.id = 'form' + this.id + 'b';
        hdB_hi_a.className = this.hidden ? 'cards-icon-button2 cards-directions-icon' : 'cards-icon-button cards-directions-icon';
        hdB_hi_a.onclick = function() {
            self.setHidden(!self.hidden);
//            console.log(">["+self.hidden+"]");
        };
//        if (my_action != null)


        hdB_hi.appendChild(hdB_hi_a);
        hdB_h.appendChild(hdB_hi);
        hdB.appendChild(hdB_h);


        //----------------------------------------------------------------
        var hdL;
        hdL = document.createElement("div");
        hdL.className = 'cards-entity-left';

        var hd3;
        hd3 = document.createElement("div");
        hd3.className = 'cards-show-expanded';

        var hd4;
        hd4 = document.createElement("div");
        hd4.id = 'form_title' + this.id;
        hd4.className = 'cards-entity-title cards-strong cards-text-truncate-and-wrap';
        hd4.innerHTML = this.title;

        var hd4B;
        hd4B = document.createElement("div");
        hd4B.id = 'form_title' + this.id + "_b";
        hd4B.className = 'cards-entity-title cards-strong cards-text-truncate-and-wrap';
        if (this.sub_title == '')
            hd4B.setAttribute("style", "font-weight: lighter; font-size: 14px ! important;display:none;");
        else
            hd4B.setAttribute("style", "font-weight: lighter; font-size: 14px ! important;");
        hd4B.innerHTML = this.sub_title;


        //----------------------------------------------------------------
        var hdR;
        hdR = document.createElement("div");
        if (my_action == null)
            hdR.className = 'cards-entity-right-b';
        else
            hdR.className = 'cards-entity-right';

        var hdR_h;
        hdR_h = document.createElement("div");
        hdR_h.className = 'hideable-element';

        var hdR_hi;
        hdR_hi = document.createElement("div");
        hdR_hi.className = 'cards-entity-icons cards-disable-text-selection';

        var hdR_hi_a;
        hdR_hi_a = document.createElement("a");
        hdR_hi_a.id = 'form' + this.id + 'a';
        hdR_hi_a.className = 'cards-icon-link cards-directions-icon';
        if (my_action != null)
            hdR_hi_a.onclick = my_action;

//        var hdR_hi_as;
//        hdR_hi_as = document.createElement("span");
//        hdR_hi_as.className = 'cards-text-truncate-and-wrap';
//        hdR_hi_as.innerHTML = 'Arriba';

//        hdR_hi_a.appendChild(hdR_hi_as);
        hdR_hi.appendChild(hdR_hi_a);
        hdR_h.appendChild(hdR_hi);
        hdR.appendChild(hdR_h);



        hd3.appendChild(hd4);
        hd3.appendChild(hd4B);
        hdL.appendChild(hd3);
        hd.appendChild(hdB);
        hd.appendChild(hdL);
        hd.appendChild(hdR);

        var html2;
        html2 = document.createElement("div");
        html2.className = 'cards-expanded';
        html2.id = this.id + '-c';
        if (this.itemlist.length == 0)
            html2.style.display = 'none';
        html2.style.display = this.hidden ? 'none' : 'block';
//        console.log(">>"+this.hidden+">>"+'none');
//        html2.onmouseover = function(event) {
//            console.log("dentro del frame principal");
//        };
//        html2.onmouseout = function(event) {
//            console.log("fuera del frame principal");
//        };


        var html3;
        html3 = document.createElement("div");
        html3.className = 'cards-explore';

        html3.setAttribute("style", "padding:" + this.p + " !important");//className = 'cards-explore';
//        if (this.p != null)
        // html3.style.padding = this.p;//'0';

        var html4;
        html4 = document.createElement("div");
        html4.id = this.id + "content";
        html4.className = 'cards-show-expanded';


        html3.appendChild(html4);
        html2.appendChild(html3);

        html.appendChild(hd);

        html.appendChild(html2);

//        html.style.height = this.height + 'px';
        if (this.itemlist.length > 0) {

            for (var i = 0; i < this.itemlist.length; i++) {
                //item de colores
                if (i > 0 & (i) <= (this.itemlist.length - 1)) {
                    var html5;
                    html5 = document.createElement("hr");
                    html5.className = 'horizontal-line';

                    html4.appendChild(html5);
                }
                html4.appendChild(this.itemlist[i].render());
            }
        }


        return html;
    };

    /**
     * @Name
     * */
    this.getId = function() {
        return this.id;
    };

    /**
     * @Name setWidth
     * @param {String} w Titulo del formulario
     * */
    this.setWidth = function(w) {
        this.width = w;
        if (document.getElementById(this.id) != null | document.getElementById(this.id) != undefined)
            document.getElementById(this.id).style.width = this.width + 'px';
    };

    this.setContentPadding = function(p) {
        this.p = p;
    };

    this.setTop = function(t) {
        this.t = t;
        if (document.getElementById(this.id) != null | document.getElementById(this.id) != undefined)
            document.getElementById(this.id).style.top = this.t + 'px';
    };

    this.setAction = function(action) {
        my_action = action;
        if (document.getElementById(this.id) != null | document.getElementById(this.id) != undefined) {
            document.getElementById('form' + id + 'a').onclick = my_action;
        }
    };

    this.removeAction = function() {
        my_action = null;
        document.getElementById('form' + id + 'a').onclick = null;
    };

    /**
     * @Name addElement
     * @param {String} item Titulo del formulario
     * */
    this.addElement = function(item) {
        this.itemlist[this.itemlist.length] = item;
        if (document.getElementById(this.id) != null | document.getElementById(this.id) != undefined) {
            if (this.itemlist.length == 1) {
                document.getElementById(this.id + "content").parentNode.parentNode.style.display = 'inherit';
            } else if (this.itemlist.length > 1) {
                var html5;
                html5 = document.createElement("hr");
                html5.className = 'horizontal-line';

                document.getElementById(this.id + "content").appendChild(html5);
            }
            document.getElementById(this.id + "content").appendChild(this.itemlist[this.itemlist.length - 1].render());
        }
    };

    this.clearAllElements = function() {
        document.getElementById(this.id + "content").innerHTML = "";
        this.itemlist = [];
    };

    /**
     * @Name setVisible
     * @param {String} visible Visibilidad del formulario
     * */
    this.setVisible = function(visible) {
        this.visible = visible;
//        console.log("aqui:" + this.visible + "[" + document.getElementById(this.id) + "][" + this.id + "]");
        if (document.getElementById(this.id) != undefined) {
            document.getElementById(this.id).style.display = this.visible ? 'block' : 'none';
        }
    };

    this.setHidden = function(hidden) {
        this.hidden = hidden;
//       console.log("aqui:" + this.visible + "[" + document.getElementById(this.id) + "][" + this.id + "]");
        if (document.getElementById(this.id) !== undefined) {
            document.getElementById(this.id + "-c").style.display = this.hidden ? 'none' : 'block';
//            console.log(">>>" + 'form' + this.id + 'b');
            if (this.hidden) {
//                document.getElementById('form' + this.id + 'b').style.backgroundImage ="url('../img/geo/maximize.png')";
                document.getElementById('form' + this.id + 'b').className = "cards-icon-button2 cards-directions-icon";
            } else {
                document.getElementById('form' + this.id + 'b').className = "cards-icon-button cards-directions-icon";
            }
//            document.getElementById('form' + this.id + 'b').style.backgroundImage ="url('../../img/geo/"+this.hidden ? 'maximize' : 'minimize'+".png')";

        }
    };

    this.setTitle = function(title) {
        this.title = title;
        if (document.getElementById(this.id) != undefined) {
            document.getElementById('form_title' + this.id).innerHTML = this.title;
        }
    };

    this.getTitle = function() {
        return this.title;
    };

    this.setSub_title = function(sub_title) {
        this.sub_title = sub_title;
        if (this.sub_title != '') {
            document.getElementById('form_title' + this.id + "_b").innerHTML = this.sub_title;
            document.getElementById('form_title' + this.id + "_b").style.display = 'block';
            document.getElementById('form_' + this.id).style.padding = '15px 5px 1px 2px';
        }
    };

    this.getSub_title = function() {
        return this.sub_title;
    };


}
//Linea obligatoria
Form.prototype = new Rear;

function Element(object) {
    this.object = object;
}

Element.prototype = new Rear;

//function Item(co_item, no_item, no_subitem) {
function Item(options) {
    Element.call(this, options.co_item);
    this.id = "item";
    this.co_item = options.co_item;
    this.no_item = options.no_item;
    this.no_subitem = options.no_subitem == undefined ? '' : options.no_subitem;
    this.image = options.image;
    this.height = null;
    this.enabled = options.enabled;
    var self = this;
    var my_action = null;
    var my_action2 = null;
    var my_action_over = null;
    var my_action_out = null;

    this.render = function() {
        console.log("llamando al render de la capa  :: name:" + this.name);
        var hd;
        var hd_img;
        var hd_c1;
        var hd_c1_h1;
        var hd_c1_h2;
        var hd_x;
        var hd_x1;
        var hd_x1_1;
        var hd_x1_2;
        var hd_x1_2a;

        var hd_x1_3;
        var hd_x1_3a;

        hd = document.createElement("div");
        hd.id = this.id + this.co_item;
        hd.className = 'cards-explore-this-area';
        hd.onmouseover = function(event) {
            hd.className = 'cards-explore-this-area cards-explore-this-area-selected';
        };
        hd.onmouseout = function(event) {
            hd.className = 'cards-explore-this-area';
        };
        hd.style.opacity = this.enabled ? 1 : 0.5;

//        if (my_action != null)
//            hd.onclick = my_action;

        hd_img = document.createElement("img");
        hd_img.id = this.id + "img"
        hd_img.className = 'cards-explore-section-image';
        hd_img.src = this.image;
        if (this.image == null)
            hd_img.style.display = 'none';

//        hd.appendChild(hd_img);

        hd_c1 = document.createElement("div");
        hd_c1.className = 'cards-explore-section-content';
        hd_c1.id = this.id + this.co_item + "c";
        if (my_action != null)
            hd_c1.onclick = my_action;
        if (my_action_over != null)
            hd_c1.onmouseover = my_action_over;
        if (my_action_out != null)
            hd_c1.onmouseout = my_action_out;
        if (my_action2 == null)
            hd_c1.style.width = '100%';

        hd_c1.appendChild(hd_img);

        hd_c1_h1 = document.createElement("h1");
        hd_c1_h1.className = 'cards-explore-section-title';
        hd_c1_h1.innerHTML = this.no_item;

        hd_c1_h2 = document.createElement("h1");
        hd_c1_h2.className = 'cards-explore-section-subtitle';
        hd_c1_h2.innerHTML = this.no_subitem;


        //---------------------------------------------------------------------------------------------------
//        hd_x = document.createElement("div");
//        hd_x.className = 'cards-zero-input-directions';

        hd_x1 = document.createElement("div");
        hd_x1.className = 'cards-zero-input-directions-content';
        if (my_action2 != null)
            hd_x1.onclick = my_action2;
        else
            hd_x1.style.display = 'none';

//        hd_x1_1 = document.createElement("div");
//        hd_x1_1.className = 'vertical-divider';

        hd_x1_2 = document.createElement("a");
        hd_x1_2.className = 'cards-icon-link2 cards-directions-icon cards-zero-input-directions-icon';
        hd_x1_2.style.display = 'block';

        hd_x1_2a = document.createElement("span");
        hd_x1_2a.className = 'cards-text-truncate-and-wrap';
        hd_x1_2a.innerHTML = 'Visible';

        hd_x1_3 = document.createElement("a");
        hd_x1_3.className = 'cards-icon-link2 cards-directions-icon cards-zero-input-directions-icon';

        hd_x1_3a = document.createElement("span");
        hd_x1_3a.className = 'cards-text-truncate-and-wrap';
        hd_x1_3a.innerHTML = 'Opciones';


//        hd_x1.appendChild(hd_x1_1);
        hd_x1_2.appendChild(hd_x1_2a);
//        hd_x1_3.appendChild(hd_x1_3a);
        hd_x1.appendChild(hd_x1_2);
//        hd_x1.appendChild(hd_x1_3);
//        hd_x.appendChild(hd_x1);


        hd_c1.appendChild(hd_c1_h1);
        hd_c1.appendChild(hd_c1_h2);
        /*->*///hd_c1.appendChild(hd_x1);
        hd.appendChild(hd_c1);
        hd.appendChild(hd_x1);
//        hd.appendChild(hd_x);

        return hd;
    };

    this.setImage = function(image) {
        this.image = image;
        if (document.getElementById(this.id) != null | document.getElementById(this.id) != undefined) {
            document.getElementById(this.id + "img").src = this.image;
        }
    };

    this.clearImage = function() {
        this.image = null;
    };

    this.setHeight = function(h) {
        this.height = h;
        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
            document.getElementById(this.id + "" + this.co_item).style.height = this.height;
        }
    };

    this.setEnabled = function(enabled) {
//        self.enabled = enabled;
        console.log("setEnabled:" + this.id + "-----" + self.id);
        if (document.getElementById(self.id + "" + self.co_item) != null | document.getElementById(self.id + "" + self.co_item) != undefined) {
            document.getElementById(self.id + self.co_item).style.opacity = self.enabled ? 1 : 0.5;
        }
    };

    this.isEnabled = function() {
        return this.enabled;
    }

    this.setAction = function(action) {
        my_action = action;
        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
            document.getElementById(this.id + this.co_item + "c").onclick = my_action;
        }
    };

    this.removeAction = function() {
        my_action = null;
        document.getElementById(this.id + this.co_item + "c").onclick = null;
    };

    this.setextraAction = function(action) {
        my_action2 = action;
        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
            document.getElementById(this.id + this.co_item + "c2").onclick = my_action2;
        }
    };

    this.removeextraAction = function() {
        my_action2 = null;
        document.getElementById(this.id + this.co_item + "c2").onclick = null;
    };

    this.setMouseOverAction = function(action) {
        my_action_over = action;
        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
            document.getElementById(this.id + this.co_item + "c").onclick = my_action_over;
            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area cards-explore-this-area-selected';
        }
    };

    this.removeMouseOverAction = function() {
        my_action_over = null;
        document.getElementById(this.id + this.co_item).onmouseover = new function() {
            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area cards-explore-this-area-selected';
        };
    };

    this.setMouseOutAction = function(action) {
        my_action_out = action;
        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
            document.getElementById(this.id + this.co_item + "c").onclick = my_action_out;
            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area';
        }
        ;
    };

    this.removeMouseOutAction = function() {
        my_action_out = null;
        document.getElementById(this.id + this.co_item).onmouseout = new function() {
            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area';
        };
    };

    this.click_eye = function() {
        console.log("click_eye");
        self.object.cambiarVisibilidad();
    };

    this.click_expand = function() {
        console.log("click_expand");
    };
}

Item.prototype = new Element;


function Item2(co_item, no_item) {
    Element.call(this, co_item);
    this.id = "item";
    var self = this;
    this.co_item = co_item;
    this.no_item = no_item;
    var my_action = null;

    this.render = function() {
//        console.log("llamando al render de la capa  :: name:" + this.name);
        var hd;
        hd = document.createElement("div");
        hd.id = this.id + this.co_item;
        hd.className = 'searchbox searchbox-shadow';
//        hd.onmouseover = function(event) {
//            hd.className = 'cards-explore-this-area cards-explore-this-area-selected';
//        };
//        hd.onmouseout = function(event) {
//            hd.className = 'cards-explore-this-area';
//        };
        if (my_action != null)
            hd.onclick = my_action;

        var hd_table;
        var hd_buttom;
        var hd_table_tr;
        var hd_table_tr_td1;
        var hd_table_tr_td1_input;
        var hd_table_tr_td2;
        var hd_table_tr_td2_div;
        var hd_table_tr_td2_div_a;
        var hd_table_tr_td2_div_a_san;

        hd_table = document.createElement("table");
        hd_table.className = 'gstl_50 searchboxinput';
        hd_table.cellspacing = 0;
        hd_table.cellpadding = 0;

        hd_table_tr = document.createElement("tr");

        hd_table_tr_td1 = document.createElement("td");
        hd_table_tr_td1.className = 'gsib_a';

        hd_table_tr_td1_input = document.createElement("input");
        hd_table_tr_td1_input.className = 'tactile-searchbox-input';
        hd_table_tr_td1_input.onfocus = function() {
            document.getElementById(self.id + self.co_item).className = 'searchbox-activo searchbox-shadow';
        };
        hd_table_tr_td1_input.onblur = function() {
            document.getElementById(self.id + self.co_item).className = 'searchbox searchbox-shadow';
        };

        hd_table_tr_td1.appendChild(hd_table_tr_td1_input);

        hd_table_tr_td2 = document.createElement("td");
        hd_table_tr_td2.className = 'gsib_b';
        hd_table_tr_td2.dir = 'ltr';

        hd_table_tr_td2_div = document.createElement("div");
        hd_table_tr_td2_div.className = 'gsst_b';

        hd_table_tr_td2_div_a = document.createElement("a");
        hd_table_tr_td2_div_a.className = 'gsst_a';

        hd_table_tr_td2_div_a_san = document.createElement("span");
        hd_table_tr_td2_div_a_san.className = 'gscb_a';

        hd_table_tr_td2_div.appendChild(hd_table_tr_td2_div_a);
        hd_table_tr_td2_div_a.appendChild(hd_table_tr_td2_div_a_san);

        hd_table_tr_td2.appendChild(hd_table_tr_td2_div);

        hd_table_tr.appendChild(hd_table_tr_td1);
        hd_table_tr.appendChild(hd_table_tr_td2);

        hd_table.appendChild(hd_table_tr);


        hd_buttom = document.createElement("buttom");
        hd_buttom.className = 'searchbutton';

        hd.appendChild(hd_table);
        hd.appendChild(hd_buttom);

        return hd;
    };

//    this.setAction = function(action) {
//        my_action = action;
//        if (document.getElementById(this.id + "" + this.co_item) != null | document.getElementById(this.id + "" + this.co_item) != undefined) {
//            document.getElementById(this.id + "" + this.co_item).onclick = my_action;
//        }
//    };
//
//    this.removeAction = function() {
//        my_action = null;
//        document.getElementById(this.id + this.co_item).onclick = null;
//    };
//
//    this.setMouseOverAction = function(action) {
//        document.getElementById(this.id + this.co_item).onmouseover = new function() {
//            action();
//            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area cards-explore-this-area-selected';
//        };
//    };
//
//    this.removeMouseOverAction = function() {
//        document.getElementById(this.id + this.co_item).onmouseover = new function() {
//            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area cards-explore-this-area-selected';
//        };
//    };
//
//    this.setMouseOutAction = function(action) {
//        document.getElementById(this.id + this.co_item).onmouseout = new function() {
//            action();
//            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area';
//        };
//    };
//
//    this.removeMouseOutAction = function() {
//        document.getElementById(this.id + this.co_item).onmouseout = new function() {
//            document.getElementById(this.id + this.co_item).className = 'cards-explore-this-area';
//        };
//    };
//
//    this.click_eye = function() {
//        console.log("click_eye");
//        self.object.cambiarVisibilidad();
//    };
//
//    this.click_expand = function() {
//        console.log("click_expand");
//    };
}

Item2.prototype = new Element;





function EEntida(entidad) {
    Element.call(this, entidad);
    var self = this;

    this.render = function() {
        var html = $D.n_E("div");
        var table = $D.n_E("table");
        var table = $D.n_E("table", null, null, null, null, "entidad_table");
        var tr1 = $D.n_E("tr");
        var td1 = $D.n_E("td", null, null, null, this.object.no_entgeo, "entidad_table_nombre_td");
        td1.setAttribute('rowSpan', '2');
        tr1.appendChild(td1);
        var td2 = $D.n_E("td");
        var img_ojo = $D.n_E("img", null, null, null, null, "ojo_img");
//        img_ojo.src = "../img/gps/eye_open.png";
        img_ojo.src = "../../img/gps/eye_open.png";
        img_ojo.onclick = this.click_eye;
        td2.appendChild(img_ojo);
        tr1.appendChild(td2);
        table.appendChild(tr1);
        var tr2 = $D.n_E("tr");
        var td3 = $D.n_E("td", null, null, null, "o");
        tr2.appendChild(td3);
        table.appendChild(tr2);
        html.appendChild(table);
        return html;
    };

    this.click_eye = function() {
        console.log("click_eye");
        self.object.cambiarVisibilidad();
    };

    this.click_expand = function() {
        console.log("click_expand");
    };
}